<?php

/**
 * ExamResult form base class.
 *
 * @package    elearning
 * @subpackage form
 * @author     Your name here
 */
class BaseExamResultForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'           => new sfWidgetFormInputHidden(),
      'exam_test_id' => new sfWidgetFormPropelChoice(array('model' => 'ExamTest', 'add_empty' => false)),
      'student_id'   => new sfWidgetFormPropelChoice(array('model' => 'Student', 'add_empty' => false)),
      'marks'        => new sfWidgetFormInput(),
      'note'         => new sfWidgetFormTextarea(),
      'created_at'   => new sfWidgetFormDateTime(),
      'updated_at'   => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'           => new sfValidatorPropelChoice(array('model' => 'ExamResult', 'column' => 'id', 'required' => false)),
      'exam_test_id' => new sfValidatorPropelChoice(array('model' => 'ExamTest', 'column' => 'id')),
      'student_id'   => new sfValidatorPropelChoice(array('model' => 'Student', 'column' => 'id')),
      'marks'        => new sfValidatorInteger(),
      'note'         => new sfValidatorString(array('required' => false)),
      'created_at'   => new sfValidatorDateTime(array('required' => false)),
      'updated_at'   => new sfValidatorDateTime(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('exam_result[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'ExamResult';
  }


}
